package cn.lin.service.impl;

import cn.lin.domain.Classes;
import cn.lin.domain.Organization;
import cn.lin.domain.Role;
import cn.lin.mapper.ClassesRapper;
import cn.lin.service.ClassesService;
import cn.lin.util.KeyWords;
import cn.lin.vo.ClassesVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassseServiceImpl implements ClassesService {

    @Autowired
    private ClassesRapper classesRapper;
    @Override
    public Role findUser(int id) {
        return classesRapper.findUser(id);
    }

//    @Override
//    public List<Classes> findstudentclasses(String username,String is_end) {
//        return classesRapper.findstudentclasses(username, KeyWords.is_star);
//    }



//    @Override
//    public List<Classes> findstudentclassesend(String username,String is_end) {
//        return classesRapper.findstudentclasses(username, KeyWords.is_end);
//    }

    @Override
    public List<ClassesVo> teacherstar(int id,String is_end) {
        return classesRapper.findteacherclasses(id, KeyWords.is_star);
    }

    @Override
    public List<ClassesVo> teacherend(int id,String is_end) {
        return classesRapper.findteacherclasses(id, KeyWords.is_end);
    }

    @Override
    public List<ClassesVo> findeteacherclassesallstar(int id, String is_end) {
        return classesRapper.findeteacherclassesall(id, KeyWords.is_star);
    }

    @Override
    public List<ClassesVo> findeteacherclassesallend(int id, String is_end) {
        return classesRapper.findeteacherclassesall(id, KeyWords.is_end);
    }

    @Override
    public List<Organization> findAllOrganization() {
        return classesRapper.findAllOrganization();
    }
}
